package com.yan.demo.method;

public class MethodTest11 {
    public static void main(String[] args) {
        for (int i = 100; i < 999; i++) {
            print(i);
        }
    }

    // 判断是否为水仙花数
    public static void print(int num) {
        int bit1 = num % 10;
        int bit2 = num / 10 % 10;
        int bit3 = num / 100 % 10;
        if(Math.pow(bit1,3) + Math.pow(bit2,3) + Math.pow(bit3,3) == num){
            System.out.print(num + " ");
        }
    }
}
